
package com.monlyu.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.monlyu.annotation.Comment;

/********************************************************************************
 * <b>功能描述☞</b>放入一些基础的参数信息<br>
 * <b>开发公司☞</b>重庆唯尼科技有限公司<br>
 * <b>版权☞</b>本文件归重庆唯尼科技有限公司所有<br>
 * <b>项目名☞</b>monlyu<br>
 * <b>文件路径☞</b>com.monlyu.vo.Enums.java<br>
 * <b>开发日期☞</b>2010-1-30 <br>
 * 
 * @author monlyu
 * @since JDK 5
 * @version 1.0.8
 ********************************************************************************/
@Entity(name = "t_enums")
@Comment(common = "参数信息表")
public class Enums extends BaseVo {

    @Id
    @Column(name = "e_id", nullable = false)
    @Comment(common = "编号")
    private Long id;

    @Column(name = "e_type", nullable = false, length = LENGTH_50)
    @Comment(common = "类型")
    private String type;

    @Column(name = "e_key", length = LENGTH_50)
    @Comment(common = "list显示值 ")
    private String key;

    @Column(name = "e_value", length = MAX_VCHAR_MYSQL)
    @Comment(common = "后台代表的值")
    private String value;

    @Column(name = "e_disable")
    @Comment(common = "是否为不可用")
    private boolean disable = false;

    @Column(name = "e_comment", length = MAX_VCHAR_MYSQL)
    @Comment(common = "备注")
    private String comment;

    @ManyToOne
    @JoinColumn(name = "e_supor")
    @Comment(common = "父类的ID号")
    private Enums supor;

    public Enums getSupor(){
        return supor;
    }

    public void setSupor(Enums supor){
        this.supor = supor;
    }

    public String getKey(){
        return key;
    }

    public void setKey(String key){
        this.key = key;
    }

    public Long getId(){
        return id;
    }

    public void setId(Long id){
        this.id = id;
    }

    public String getType(){
        return type;
    }

    public void setType(String type){
        this.type = type;
    }

    public String getValue(){
        return value;
    }

    public void setValue(String value){
        this.value = value;
    }

    public boolean isDisable(){
        return disable;
    }

    public void setDisable(boolean disable){
        this.disable = disable;
    }

    public String getComment(){
        return comment;
    }

    public void setComment(String comment){
        this.comment = comment;
    }

    @Override
    public String toString(){
        if (getSupor() == null) {
            return "一级";
        } else {
            return getSupor().getKey();
        }
    }
}
